 import java.io.*; /**   * 统计文本文件的行数，单词书，字符数  */  
 class WordCount {      
     public static int words = 1;     
     public static int lines = 1;     
     public static int chars = 0;     
     public static void main(String args[]) {         
            FileInputStream f; 
        try {              
            if (args.length == 0) { // 检查是否读入                 
            f = new FileInputStream("input.txt");                 
            Lib.wc(f);              
            } else { // 判断行                                   
                 f = new FileInputStream(args[0]);                     
                 Lib.wc(f);                  
                  }          
                  } catch (IOException e) {             
                      return;         
                      }          
                      System.out.println(lines + "行 " + words + "个单词 " + chars + "个字符");  
                      new Lib(args[0]).statistics;  
                       }    